<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>keyFrames</title>
</head>
    <style>
        @keyframes a{
            0%{
                width: 100px;
            }
            100%{
                width: 800px;
            }
        }
        div:nth-of-type(1){
            width: 100px; 
            height: 100px;
            background: #f00;
            animation: a 3s;
        }
        @keyframes b{
            100%{
                width: 200px;
            }
        }
        div:nth-of-type(2){
            width: 100px; 
            height: 100px;
            background: #00f;
            animation: b 2s linear 3 alternate backwards;
        }
    </style>
<body>
    <div></div>
    <div></div>
</body>
</html>